Add an item in a TupleΒΆ

T = T + (9,) - new tuple
T = T[:5] + (15, 20, 25) + T[:5]
L = list(T); L.append(30); T = tuple(L)

Add an item in a Tuple.
# create a tuple
T = (4, 6, 2, 8, 3, 1)
print(T)                                       # (4, 6, 2, 8, 3, 1)

# tuples are IMMUTABLE, so you can not add new elements
# using merge of tuples with the + operator
# you can add an element and it will CREATE A NEW TUPLE
T = T + (9,)
print(T)                                       # (4, 6, 2, 8, 3, 1, 9)

# adding items in a specific INDEX
T = T[:5] + (15, 20, 25) + T[:5]
print(T)                                       # (4, 6, 2, 8, 3, 15, 20, 25, 4, 6, 2, 8, 3)

# converting the tuple to list
L = list(T)

# use different ways to add items in list
L.append(30)

T = tuple(L)
print(T)                                       # (4, 6, 2, 8, 3, 15, 20, 25, 4, 6, 2, 8, 3, 30)